<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>判断一个年份是闰年还是平年</title>
</head>

<body>
    <script>
        var year = 2024;
        if (year > 0) {
            if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                console.log(year + "是闰年");
            } else {
                console.log(year + "是平年");
            }
        }
    </script>
</body>

</html>